﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PointOfSale
{
    public partial class Form2 : Form
    {
        public DataSet datos;
        List<string> items = new List<String>();
        List<string> precios = new List<String>();
        List<decimal> cantidades = new List<decimal>();

        public Form2()
        {
            InitializeComponent();
        }

        public void loadDatos(){
            bindingSource1.DataSource = datos.Tables[0];
            listBox1.DataSource = items;
            listBox2.DataSource = cantidades;
            listBox3.DataSource = precios;

        }

        public void setPub1(string path){
            this.pictureBox1.ImageLocation=path;
        }
        public void setPub2(string path)
        {
            this.pictureBox2.ImageLocation = path;
        }
        public void setPub3(string path)
        {
            this.pictureBox3.ImageLocation = path;
        }
        public void setEmpresa(string empresa, string imagen)
        {
            this.nombre.Text = empresa;
            this.logoEmpresa.ImageLocation = imagen;
        }

        private void butConfig_Click(object sender, EventArgs e)
        {
            Form3 f = new Form3();
            f.fm = this;
            f.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String descripcion = datos.Tables[0].Rows[comboBox1.SelectedIndex].ItemArray[9].ToString();
            String imagenArticulo = datos.Tables[0].Rows[comboBox1.SelectedIndex].ItemArray[7].ToString();
            Form4 f = new Form4(descripcion, imagenArticulo);
            f.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            items.Add(comboBox1.SelectedValue.ToString());
            listBox1.DataSource = null;
            listBox1.DataSource = items;
            
           // precios.Add(comboBox4.SelectedValue.ToString());
           // cantidades.Add(numericUpDown1.Value);
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
